home *** CD-ROM | disk | FTP | other *** search
/ Windows Expert / Windows Expert.iso / windownt / uupc11ys.zip / LIB / HOSTABLE.H < prev    next >
C/C++ Source or Header  |  1992-12-30  |  5KB  |  116 lines

  1. /*
  2.    hostable.h
  3.  
  4.    routines included in hostable.c
  5.  
  6.    Copyright (c) 1989, 1990  Andrew H. Derbyshire
  7.  
  8.    Update History:
  9.  
  10.    18Mar90     Create from router.c                                  ahd
  11.    21Dec92     Make all "enum hostatus"'s into unsigned shorts for
  12.                NT portability                                        dmw
  13.  */
  14.  
  15.  /*
  16.   *   $Id: HOSTABLE.H 1.2 1992/12/30 12:52:31 dmwatt Exp $
  17.   *
  18.   *   $Log: HOSTABLE.H $
  19.  *     Revision 1.2  1992/12/30  12:52:31  dmwatt
  20.  *     Use shorts for table to insure compatiablity across 32 bit/16 bit OSes
  21.  *
  22.   */
  23.  
  24. #ifndef __HOSTABLE
  25. #define __HOSTABLE
  26.  
  27. #ifndef __LIB
  28. #error Need "LIB.H"
  29. #endif
  30.  
  31. #define UUCPSHELL "uucp"         /* Shell for UUCP users                */
  32. #define ANONYMOUS_HOST "*anonymous" /* Anonymous systems                */
  33.  
  34. #define BADHOST NULL
  35.  
  36. #define HOSTLEN   8           /* max length of host name without '\0'   */
  37.  
  38. /*--------------------------------------------------------------------*/
  39. /*    Note in the following table that "fake" hosts must precede      */
  40. /*    "nocall" and "real" hosts must follow it.                       */
  41. /*--------------------------------------------------------------------*/
  42.  
  43. typedef enum
  44.                 { phantom = 0,      /* Entry not fully initialized      */
  45.                   localhost,        /* This entry is for ourselves      */
  46.                   gatewayed,        /* This entry is delivered to via   */
  47.                                     /* an external program on local sys */
  48.                   nocall,           /* real host, never called          */
  49.                   autodial,         /* Dialing the phone now            */
  50.                   invalid_device,   /* Invalid systems file             */
  51.                   nodevice,         /* Could not open device            */
  52.                   startup_failed,   /* Determined system, start failed  */
  53.                   inprogress,       /* Call now active                  */
  54.                   callback_req,     /* System must call us back         */
  55.                   dial_script_failed,
  56.                                     /* Modem initialize failed          */
  57.                   dial_failed,      /* Hardcoded auto-dial failed       */
  58.                   script_failed,    /* script in L.SYS failed           */
  59.                   max_retry,        /* Have given up calling this sys   */
  60.                   too_soon,         /* In retry mode, too soon to call  */
  61.                   succeeded,        /* self-explanatory                 */
  62.                   wrong_host,       /* Call out failed, wrong system    */
  63.                   unknown_host,     /* Call in failed, unknown system   */
  64.                   call_failed,      /* Connection aborted for various
  65.                                        reasons                          */
  66.                   wrong_time,       /* Unable to call because of time   */
  67.                   called,           /* success this run of UUCICO       */
  68.                   last_status }
  69.                         hostatus;
  70.  
  71. /*--------------------------------------------------------------------*/
  72. /*                          Status information                        */
  73. /*--------------------------------------------------------------------*/
  74.  
  75. struct HostStats {
  76.       time_t ltime;              /* Last time this host was called      */
  77.       time_t lconnect;           /* Last time we actually connected     */
  78.       unsigned long calls;       /* Total number of calls to host       */
  79.       unsigned long connect;     /* Total length of connections to host */
  80.       unsigned long fsent;       /* Total files sent to this host       */
  81.       unsigned long freceived;   /* Total files received from this host */
  82.       unsigned long bsent;       /* Total bytes sent to this host       */
  83.       unsigned long breceived;   /* Total bytes received from this host */
  84.       unsigned long errors;      /* Total transmission errors noted     */
  85.       unsigned long packets;     /* Total packets exchanged             */
  86.       unsigned short save_hstatus;
  87.    };
  88.  
  89. /*--------------------------------------------------------------------*/
  90. /*                          Master hostable                           */
  91. /*--------------------------------------------------------------------*/
  92.  
  93. struct  HostTable {
  94.       char  *hostname;           /* Name of the host in question        */
  95.       char  *via;                /* Host hostname is routed via         */
  96.       char  *realname;           /* Alias of this host name             */
  97.       struct HostStats *hstats;  /* Point to stats for real hosts only  */
  98.       struct HostSecurity *hsecure; /* Security Information, real hosts
  99.                                        only                             */
  100.       boolean anylogin;          /* TRUE = Can login with any generic
  101.                                     user id                             */
  102.       boolean  aliased;          /* TRUE = alias has been optimized     */
  103.       boolean  routed;           /* TRUE = route has been optimized     */
  104.       unsigned short hstatus;          /* host status, as defined by hostatus */
  105.    };
  106.  
  107. struct HostTable *searchname(const char *name, const size_t namel);
  108.  
  109. struct HostTable *checkname(const char *name);
  110.  
  111. struct HostTable *checkreal(const char *name);
  112.  
  113. struct HostTable *nexthost( const boolean start );
  114.  
  115. #endif
  116.